package hxs.events.flash.net;
import flash.net.Socket;
import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.events.SecurityErrorEvent;
import flash.events.ProgressEvent;
import flash.events.HTTPStatusEvent;
import flash.net.URLLoader;
import flash.net.URLStream;
import hxs.events.flash.events.EventDispatcherEvents;
import hxs.extras.FlashSignal;
import hxs.extras.FlashEventsStore;

/**
 * ...
 * @author Tony Polinelli
 */

class URLStreamEvents extends EventDispatcherEvents
{

	public function new(target:URLStream) 
	{
		super(target);
	}
	
	public static function getEvents(target:URLStream):URLStreamEvents
	{
		return cast FlashEventsStore.getEvents(target);
	}
	
	/* */
	
	public var complete(getComplete, never):FlashSignal<Event>;
	private function getComplete():FlashSignal<Event>
	{
		return cast getNativeSignal(Event.COMPLETE);
	}

	public var httpStatus(getHttpStatus, never):FlashSignal<HTTPStatusEvent>;
	private function getHttpStatus():FlashSignal<HTTPStatusEvent>
	{
		return cast getNativeSignal(HTTPStatusEvent.HTTP_STATUS);
	}
	
	public var ioError(getIoError, never):FlashSignal<IOErrorEvent>;
	private function getIoError():FlashSignal<IOErrorEvent>
	{
		return cast getNativeSignal(IOErrorEvent.IO_ERROR);
	}

	
	public var open(getOpen, never):FlashSignal<Event>;
	private function getOpen():FlashSignal<Event>
	{
		return cast getNativeSignal(Event.OPEN);
	}
		
	public var progress(getProgress, never):FlashSignal<ProgressEvent>;
	private function getProgress():FlashSignal<ProgressEvent>
	{
		return cast getNativeSignal(ProgressEvent.PROGRESS);
	}
	
}